<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>岗位搜索</title>

    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" type="text/css" media="all" th:href="@{/css/tyle.css}">
    <script th:src="@{/js/jquery-1.9.1.min.js}"></script>
    <style type="text/css">
        .layui-tab-title .layui-this {
            color: #009688;
        }

        #text {
            margin-left: 20px;
            margin-top: 25px;
        }

        #list {
            margin-top: 30px;
            margin-left: 10%;
            margin-right: 10%;
        }

        body {
            background-color: #ffffff
        }

        .layui-input {
            border-color: #009688;
        }

        .layui-nav {
            padding-left: 10%;
            padding-right: 10%;
        }

        .sp {
            margin-left: 20px;
            font-size: 16px;
            color: #999;
        }
    </style>
</head>
<body><!-- ctrl + F9  -->


<ul class="layui-nav layui-bg-black">
    <img th:src="@{/images/logo.png}" style="margin-right: 30px">
    <li class="layui-nav-item"><a href="./">网站首页</a></li>
    <li class="layui-nav-item" style="float: right;">
        <div th:if="${ session.uid != null}">
            <a><img th:src="'/user/img/'+${session.uid}" class="layui-nav-img">我</a>
            <dl class="layui-nav-child">
                <dd><a th:href="'/user/user?id='+ ${session.uid}">个人中心</a></dd>
                <dd><a href="/user/upPass">修改密码</a></dd>
                <dd><a th:href="@{/user/exit}">退出</a></dd>
            </dl>
        </div>
        <div th:if="${session.uid == null}">
            <button class="layui-btn layui-btn-radius layui-btn-sm" onclick="window.location.href='/user/login'">登录
            </button>
            <button class="layui-btn layui-btn-radius layui-btn-sm" onclick="window.location.href='/user/signIn'">注册
            </button>
        </div>
    </li>
</ul>

<form class="layui-form layui-form-pane1" action="/soso" style="text-align: center" method="post">
    <div class="layui-input-inline" style="width: 100px">
        <select name="place">
            <option value="全部类别">全部类别</option>
            <div th:each="list : ${joblist}">
                <option value="IT互联网" th:value="${list}" th:text="${list}">IT互联网</option>
            </div>
        </select>
    </div>
    <div class="layui-input-inline" style="width: 300px">
        <input type="text" name="name" lay-verify="required|title" required placeholder="请输入你要应聘的职位" autocomplete="off"
               class="layui-input"/>
    </div>
    <div class="layui-input-inline">
        <input type="submit" value="搜索" class="layui-btn"/>
    </div>
</form>
<!-- 城市 -->
<div id="in_city" style="display: none"></div>

<div class="layui-tab-content" id="list">
    <span class="layui-badge-rim" style="font-size: 16px;border-color: #999;padding: 5px">
        搜索结果：共<span th:text="${number}">0</span>条
    </span>
    <div th:each="job : ${jobs}">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>
                <a th:href="'/job/job?id='+${job.getId()}" th:text="${job.jobName}" style="font-size: 18px"></a>
            </legend>
            <div class="layui-row" style="margin-top: 15px">
                <div class="layui-col-xs10">
									<span id="text">
										<a th:href="'/user/user?id='+${job.uid}" style="color: #6aa2e4;font-size: 16px"
                                           th:text="${job.jobComName}">阿里巴巴</a> - <span
                                            style="font-size: 14px;color: #999" th:text="${job.jobClass}">计算机/互联网</span>
									</span>
                    <span id="text" style="margin-left: 10%">
										<span class="sp" th:text="${job.jobWeekDay}+'天/周'"></span>  &nbsp;&nbsp;  <span
                            class="sp" th:text="${job.jobMoney}+'天'"></span>  &nbsp;&nbsp;
                        <span class="sp" th:text="${job.jobPosition}"></span>
									</span>
                </div>
                <div class="layui-col-xs2">
                    <img th:src="'/user/img/'+${job.uid}" style="width: 50px">
                </div>
            </div>
        </fieldset>
        <hr class="layui-bg-gray">
    </div>
    <span class="layui-badge-rim" style="font-size: 16px;border-color: #999;padding: 3px">
        共<span th:text="${pgnums}"></span>页
    </span>
    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-9" style="margin-left: 10%">
        <a th:href=" '/soso?name='+${name}+'&place='+${place}+'&page='+(${pgnum}-1)" class="layui-laypage-prev"
           data-page="1">上一页</a>
        <span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em th:text="${pgnum}+1"></em></span>
        <a th:href="'/soso?name='+${name}+'&place='+${place}+'&page='+(${pgnum}+1)" class="layui-laypage-next"
           data-page="2">下一页</a>
    </div>
</div>


<script th:src="@{/layui/layui.all.js}"></script>
<script>
    //由于模块都一次性加载，因此不用执行 layui.use() 来加载对应模块，直接使用即可：
    ;!function () {
        var layer = layui.layer
            , form = layui.form;
        //总页数低于页码总数

        // layer.msg('Hello World');
    }();
</script>
<script type="text/javascript" th:src="@{js/cityTemplate.js}"></script>
<script type="text/javascript">

    var cityA = $(".city_a_le1 a"); //城市
    var pla = $("#place");  //出发地
    var dest = $("#destination");  //目的地
    // 默认值
    inCity.width = "345";  //城市选择框  宽
    inCity.height = "auto";  //城市选择框  高
    inCity.id = "#in_city";  //城市选择框  父级ID
    inCity.Children = '.city_a_le1';  //城市名box
    // 初始化 城市HTML模板
    $(inCity.id).prepend(inCity._template.join(''));
    inCity.Hot(cityA);

    //城市 导航
    var apay = $(".screen a");

    var placeThis; //当前选择标签
    apay.click(function (obj) {  //城市导航
        inCity.payment($(this));
    })

    inCity.place(pla); //出发地
    inCity.destination(dest);  //目的地
    inCity.cityClick(cityA); //显示赋值城市
</script>
</body>
</html>
